package com.vhr.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class Swagger2Config {

    //添加摘要信息（Docket）
    /*
    SpringBoot默认访问地址
    http://localhost:8080/swagger-ui.html
    */
    @Bean
    public Docket controllerApi(){
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(new ApiInfoBuilder()
                .title("标题：人力资源管理系统API接口文档")
//                .description("描述：用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
//                .contact(0new Contact("一只袜子", null, null))
                .version("版本号:1.0")
                .build())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.vhr.controller"))
                .paths(PathSelectors.any())
                .build();

    }
}
